package VN.EDU.IMIC.DEVELOPER.TRANTHITHANHNGA.EXAM01.TASK1;

public class Rectangle_Controllers implements IGeometricObject {

	private Rectangle_Entity Obj;
	
	
	public Rectangle_Controllers(Rectangle_Entity obj) {
		Obj = obj;
	}
	
	@Override
	public double getArea(Object iObj) {
		Rectangle_Entity Obj = (Rectangle_Entity) iObj;
		return Obj.getHeight() * Obj.getWidth();
	}

	@Override
	public double getPerimeter(Object iObj) {
		Rectangle_Entity Obj = (Rectangle_Entity) iObj;
		return 2 * (Obj.getHeight() + Obj.getWidth());
	}
}

